package com.mysteel.authserver.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * ProjectName: mail
 * ClassName: UserRegisterVo
 * Description:
 * date: 2021/02/26/026 16:05
 *
 * @author xiaochao
 */
@Data
public class UserRegisterVo {

    @NotEmpty(message = "用户名不能为空")
    @Length(min = 2, max = 20, message = "用户名长度为2-20位")
    private String username;

    @NotEmpty(message = "密码不能为空")
    @Length(min = 6, max = 20, message = "密码长度为6-20位")
    private String password;

    @NotEmpty(message = "手机号不能为空")
    @Pattern(regexp = "^((13[0-9])|(17[0-1,6-8])|(15[^4,\\\\D])|(18[0-9])|(19[0-9]))\\d{8}$", message = "手机号码格式不正确")
    private String phone;

    @NotEmpty(message = "验证码不能为空")
    @Pattern(regexp = "^\\d{6}", message = "验证码格式错误")
    private String code;
}
